package com.jy.api.payReq;

import com.jy.api.domain.Order;
import com.jy.api.domain.Reward;
import com.jy.api.domain.StorePay;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class HuiFuQRCodeReq {

    private String termOrdId;

    private String appId;

    private String goodsDesc;

    private String memberId;

    private String ordAmt;

    private String apiVersion="3.0.0.2";

    private String merPriv;

    private String payChannelType;

    public HuiFuQRCodeReq(StorePay storePay, Reward reward) {
        this.ordAmt = String.valueOf((int) Math.rint(reward.getTotal() * 100));
        this.termOrdId = reward.getId();
        this.memberId = storePay.getMchId();


    }

    public HuiFuQRCodeReq(StorePay storePay, Order order) {
        this.ordAmt = String.valueOf((int) Math.rint(order.getAmount() * 100));
        this.termOrdId = order.getId();
        this.memberId = storePay.getMchId();
    }
}
